Call gtk_widget_activate for GDK_Return.
authorOwen Taylor <otaylor@redhat.com>
Sun, 12 Nov 2000 04:56:51 +0000 (04:56 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sun, 12 Nov 2000 04:56:51 +0000 (04:56 +0000)
Sat Nov 11 23:07:30 2000  Owen Taylor  <otaylor@redhat.com>

* gtk/gtkentry.c (gtk_entry_key_press): Call
gtk_widget_activate for GDK_Return.

* gtk/gtkentry.c (gtk_entry_preedit_changed_cb): Fix handling
of preedit cursor position.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkentry.c

index 9a74faf21fa647cd909ccfc2f06c9cefd8cadd55..3412cd862029fe2194fe29efcdb4c08048a089b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat Nov 11 23:07:30 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_key_press): Call 
+       gtk_widget_activate for GDK_Return.
+
+       * gtk/gtkentry.c (gtk_entry_preedit_changed_cb): Fix handling
+       of preedit cursor position.
+
 Sun Nov  5 04:24:53 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertextpixbuf.c: Make parent_class
index 9a74faf21fa647cd909ccfc2f06c9cefd8cadd55..3412cd862029fe2194fe29efcdb4c08048a089b0 100644 (file)
@@ -1,3 +1,11 @@
+Sat Nov 11 23:07:30 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_key_press): Call 
+       gtk_widget_activate for GDK_Return.
+
+       * gtk/gtkentry.c (gtk_entry_preedit_changed_cb): Fix handling
+       of preedit cursor position.
+
 Sun Nov  5 04:24:53 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertextpixbuf.c: Make parent_class
index 9a74faf21fa647cd909ccfc2f06c9cefd8cadd55..3412cd862029fe2194fe29efcdb4c08048a089b0 100644 (file)
@@ -1,3 +1,11 @@
+Sat Nov 11 23:07:30 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_key_press): Call 
+       gtk_widget_activate for GDK_Return.
+
+       * gtk/gtkentry.c (gtk_entry_preedit_changed_cb): Fix handling
+       of preedit cursor position.
+
 Sun Nov  5 04:24:53 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertextpixbuf.c: Make parent_class
index 9a74faf21fa647cd909ccfc2f06c9cefd8cadd55..3412cd862029fe2194fe29efcdb4c08048a089b0 100644 (file)
@@ -1,3 +1,11 @@
+Sat Nov 11 23:07:30 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_key_press): Call 
+       gtk_widget_activate for GDK_Return.
+
+       * gtk/gtkentry.c (gtk_entry_preedit_changed_cb): Fix handling
+       of preedit cursor position.
+
 Sun Nov  5 04:24:53 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertextpixbuf.c: Make parent_class
index 9a74faf21fa647cd909ccfc2f06c9cefd8cadd55..3412cd862029fe2194fe29efcdb4c08048a089b0 100644 (file)
@@ -1,3 +1,11 @@
+Sat Nov 11 23:07:30 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_key_press): Call 
+       gtk_widget_activate for GDK_Return.
+
+       * gtk/gtkentry.c (gtk_entry_preedit_changed_cb): Fix handling
+       of preedit cursor position.
+
 Sun Nov  5 04:24:53 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertextpixbuf.c: Make parent_class
index 9a74faf21fa647cd909ccfc2f06c9cefd8cadd55..3412cd862029fe2194fe29efcdb4c08048a089b0 100644 (file)
@@ -1,3 +1,11 @@
+Sat Nov 11 23:07:30 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_key_press): Call 
+       gtk_widget_activate for GDK_Return.
+
+       * gtk/gtkentry.c (gtk_entry_preedit_changed_cb): Fix handling
+       of preedit cursor position.
+
 Sun Nov  5 04:24:53 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertextpixbuf.c: Make parent_class
index 9a74faf21fa647cd909ccfc2f06c9cefd8cadd55..3412cd862029fe2194fe29efcdb4c08048a089b0 100644 (file)
@@ -1,3 +1,11 @@
+Sat Nov 11 23:07:30 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_key_press): Call 
+       gtk_widget_activate for GDK_Return.
+
+       * gtk/gtkentry.c (gtk_entry_preedit_changed_cb): Fix handling
+       of preedit cursor position.
+
 Sun Nov  5 04:24:53 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertextpixbuf.c: Make parent_class
index fcffeedf4b1c09e924bd88cf2c7432ebce7ec529..a1cb51773b3d1f4509d9134e7522e7f0e59c5658 100644 (file)
@@ -1040,15 +1040,22 @@ gtk_entry_key_press (GtkWidget   *widget,
   if (!entry->editable)
     return FALSE;
 
-  /* Activate key bindings
-   */
-  if (GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event))
+  if (gtk_im_context_filter_keypress (entry->im_context, event))
+    {
+      entry->need_im_reset = TRUE;
+      return TRUE;
+    }
+  else if (GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event))
+    /* Activate key bindings
+     */
     return TRUE;
+  else if (event->keyval == GDK_Return)
+    {
+      gtk_widget_activate (widget);
+      return TRUE;
+    }
 
-  /* Not bound, pass to input method
-   */
-  entry->need_im_reset = TRUE;
-  return gtk_im_context_filter_keypress (entry->im_context, event);
+  return FALSE;
 }
 
 static gint
@@ -1564,7 +1571,7 @@ gtk_entry_preedit_changed_cb (GtkIMContext *context,
                                     &cursor_pos);
   entry->preedit_length = strlen (preedit_string);
   cursor_pos = CLAMP (cursor_pos, 0, g_utf8_strlen (preedit_string, -1));
-  cursor_pos = g_utf8_offset_to_pointer (preedit_string, cursor_pos) - preedit_string;
+  entry->preedit_cursor = g_utf8_offset_to_pointer (preedit_string, cursor_pos) - preedit_string;
   g_free (preedit_string);
 
   gtk_entry_recompute (entry);